combo box: Fix compiler warnings
authorMatthias Clasen <mclasen@redhat.com>
Sun, 31 May 2015 01:24:23 +0000 (21:24 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 2 Jun 2015 13:08:15 +0000 (09:08 -0400)
Fix warnings due to -Wdeclaration-after-statement and -Wshadow.

gtk/gtkcombobox.c

index ccda6ad4571518cc9563c35bf4aa24401939640e..f9c7ba86e46dcf122d3e513ed61002dcf3a14373 100644 (file)
@@ -2622,14 +2622,13 @@ gtk_combo_box_size_allocate (GtkWidget     *widget,
 
           if (gtk_widget_get_visible (priv->popup_widget))
             {
-              gint width, menu_width;
+              gint menu_width;
 
               if (priv->wrap_width == 0)
                 {
                   GtkAllocation combo_box_allocation;
 
                   gtk_widget_get_allocation (GTK_WIDGET (combo_box), &combo_box_allocation);
-                  width = combo_box_allocation.width;
                   gtk_widget_set_size_request (priv->popup_widget, -1, -1);
 
                   if (combo_box->priv->popup_fixed_width)
@@ -2638,7 +2637,7 @@ gtk_combo_box_size_allocate (GtkWidget     *widget,
                     gtk_widget_get_preferred_width (priv->popup_widget, NULL, &menu_width);
 
                   gtk_widget_set_size_request (priv->popup_widget,
-                                               MAX (width, menu_width), -1);
+                                               MAX (combo_box_allocation.width, menu_width), -1);
                }
 
               /* reposition the menu after giving it a new width */